
var tableData = {
		url:ctp+"/quartzController/quartzSearch.shtml", 
		propertys : ["JOBNAME","JOBGROUP","CRON","CLASSNAME","JOBDESC","JOBSTATUS"],
	    hrefs:[["function=quartzUpdate","recId=JOBID","修改"],
	           ["function=pauseJob","recId=JOBID","暂停"],
	           ["function=resumeJob","recId=JOBID","恢复"],
	           ["function=triggerJob","recId=JOBID","执行一次"]],
//		css:["font-size:19px;",null,null,null,"[PROCESS_STATUS][1=color:red,2=color:green;]",null],//不同值的样式
		//checkBox:["REC_ID",true],//checkbox字段  默认显示且是REC_ID，true显示,false不显示
		//hidden:["PROCESS_STATUS"],//设置行隐藏
	    links:[["function=showApprovalDetail","recId=JOBNAME","0"]],      
		startLoad:function (){
			getListData(this); 	  
		}
};

function showApprovalDetail(recId) {
	alert(recId);
	//window.location.href = ctp + "/approvalClickPlayController/approvalClickPlayView.media?recId=" + recId;
}
function searchData(curr){
	setTagAndValue("form1","curr",curr);	
	tableData.startLoad(); 
}

/**只要添加这段代码，就会有全选的功能*/
$(document).ready(function(){
	changeFk(); 
	searchData();
});

function pauseJob(recId) {
	if(confirm("确定要暂停该任务吗？")){
		showLoading();
		$.ajax({
			url : ctp + "/quartzController/pauseJob.shtml?recId="+recId+"&jobStatus=0",
			data : {},
			type : 'POST',
			// dataType : 'json',
			async : false,
			success : function(result) {
				jalert9(result);
				tableData.startLoad();
			}
		});
		closeLoading();
	}
}

function quartzUpdate(JOBID) {
	dialogWin(550, 450, ctp + "/quartzController/quartzUpdate.shtml?recId="
			+ JOBID, "");
}


function resumeJob(recId) {
	if(confirm("确定要恢复该任务吗？")){
		showLoading();
		$.ajax({
			url : ctp + "/quartzController/resumeJob.shtml?recId="+recId+"&jobStatus=1",
			data : {},
			type : 'POST',
			// dataType : 'json',
			async : false,
			success : function(result) {
				jalert9(result);
				tableData.startLoad();
			}
		});
		closeLoading();
	}
}

function triggerJob(recId) {
	if(confirm("确定要立即执行一次该任务吗？")){
		showLoading();
		$.ajax({
			url : ctp + "/quartzController/triggerJob.shtml?recId="+recId,
			data : {},
			type : 'POST',
			// dataType : 'json',
			async : false,
			success : function(result) {
				jalert9(result);
				tableData.startLoad();
			}
		});
		closeLoading();
	}
}


function loginout(){
	jconfirm("out()", "是否要退出系统？");
	
}

function out(){
	window.location.href = ctp+"/loginController/loginout.shtml";
}
